package com.fengchao.dao;

import com.fengchao.model.PfmPerformanceTicket;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * Created by http://my.oschina.net/wangnian on 2016/9/13.
 */
@Mapper
public interface PfmPerformanceTicketMapper {
    /**
     * 根据id查询票
     *
     * @param id
     * @return
     */
    @Select("select id,pfm_ticket_sold_sum  from pfm_performance_ticket where id = #{id}")
    PfmPerformanceTicket findById(Integer id);

    /**
     * 更新实际购买人数
     * @param id
     * @param soldSum
     * @return
     */
    @Update("update pfm_performance_ticket set pfm_ticket_sold_sum=#{soldSum}   where id = #{id} ")
    Integer updateTicketSoldSum(@Param("id")Integer id,@Param("soldSum") Integer soldSum);

}
